#include "Loja2.h"
#include "TorusCharles.h"
#include "prateleira1bruno.h"
#include "bonecobrunomeira.h"
#include "castelobrunomeira.h"
#include "CarroCristiane.h"
#include "PalhacoCristiane.h"
#include "ShipJosh.h"
#include "BikeJosh.h"
#include "ArvoreNatalRoney.h"
#include "AnimalBrinquedoRoney.h"
#include "gllib/Objects.h"
#include "paredebruno.h"
#include "chaobruno.h"
#include "balcaojoshua.h"
#include "prateleira2joshua.h"
#include "alicercejoshua.h"
#include "caixaeletronicobruno.h"

#include <cmath>
#include <GL/glu.h>

Scene * loja2Scene() {
    Scene * loja = new Scene();

    //loja->addObject(new PrateleiraBruno(), translationMatrix(Vector3(0.0, 0.0, 0.0)));

    // PARTE DO BRUNO
//    glColor3f(1.0,0.5,0);
    loja->addObject(new CaixaEletronicoBruno(),translationMatrix(Vector3(4.4, 3.2, -1.45)));
    float color[3] = {1.0,1.0,1.0};
    loja->addObject(new ParedeBruno(color,1), translationMatrix(Vector3(0.22, 3.0, -5.15)).operator *(rotationMatrix(3.14/2,Vector3(0,1,0))).operator *(scaleMatrix(1,1,1.10)));
    float color2[3] = {1.0,1.0,1.0};
    loja->addObject(new ParedeBruno(color2,1), translationMatrix(Vector3(-5.25, 3.0, 0.0)).operator *(scaleMatrix(1,1,1.03)));
    float color3[3] = {0.4,0.0,0};
    loja->addObject(new ParedeBruno(color3,0), translationMatrix(Vector3(5.73, 3.0, 0.0)).operator *(scaleMatrix(1,1,1.03)));

    for(int i=0;i<=5;i++){
        for(int j=0;j<=5;j++){
            loja->addObject(new ChaoBruno(),translationMatrix(Vector3(-1*i, 0, -1*j)));
        }
    }
    for(int i=0;i<=5;i++){
        for(int j=0;j<5;j++){
            loja->addObject(new ChaoBruno(),translationMatrix(Vector3(i, 0, j)));
        }
    }

    for(int i=0;i<=5;i++){
        for(int j=0;j<5;j++){
            loja->addObject(new ChaoBruno(),translationMatrix(Vector3(-i, 0, j)));
        }
    }

    for(int i=0;i<=5;i++){
        for(int j=0;j<=5;j++){
            loja->addObject(new ChaoBruno(),translationMatrix(Vector3(i, 0, -j)));
        }
    }

    //Adicionando Objetos

    for(int i=1;i<10;i=i+4){
        for(int j=1;j<10;j=j+4){
            loja->addObject(new BonecoBrunoMeira(), scaleMatrix(0.2,0.2,0.2).operator *(translationMatrix(Vector3(-j-15, 10, -i-14))));
        }
    }

    for(int i=3;i<8;i=i+4){
        for(int j=2;j<8;j=j+4){
            loja->addObject(new CasteloBrunoMeira(),scaleMatrix(0.2,0.2,0.2).operator *(translationMatrix(Vector3(-j-17, 5.9, (-i-15)))));
        }
    }

    loja->addObject(new Prateleira1Bruno(), translationMatrix(Vector3(-5.0, 1.0, -3.0)));

    // FIM PARTE BRUNO

    // PARTE CRISTIANE

    for(int i=1;i<10;i=i+4){
        for(int j=1;j<10;j=j+4){
            loja->addObject(new CarroCristiane(), scaleMatrix(-0.2,0.2,-0.2).operator *(translationMatrix(Vector3(-j+10, 10.67, -i+24.5))));
        }
    }

    for(int i=3;i<10;i=i+4){
        for(int j=1;j<10;j=j+4){
            loja->addObject(new PalhacoCristiane(), scaleMatrix(-0.2,0.2,-0.2).operator *(translationMatrix(Vector3(-j+10, 5.33, -i+24.5))));
        }
    }

    loja->addObject(new Prateleira1Bruno(), translationMatrix(Vector3(-2.0, 1.0, -3.0)));

    // FIM PARTE CRISTIANE

    // PARTE JOSHUA

    loja->addObject(new balcaoJoshua(), scaleMatrix(1.5,1.5,1.5).operator *(translationMatrix(Vector3(1.6, 1.0, -1.5))));

    loja->addObject(new Prateleira2Joshua(), scaleMatrix(1.0,1.0,1.0).operator *(translationMatrix(Vector3(1.0, 5.0, -4.6))));
    loja->addObject(new Prateleira2Joshua(), scaleMatrix(1.0,1.0,1.0).operator *(translationMatrix(Vector3(-2.0, 5.0, -4.6))));
    loja->addObject(new Prateleira2Joshua(), scaleMatrix(1.0,1.0,1.0).operator *(translationMatrix(Vector3(-4.7, 5.0, -1.6)).operator *(rotationMatrix(M_PI/2,Vector3(0.0,1.0,0.0)))));
    loja->addObject(new Prateleira2Joshua(), scaleMatrix(1.0,1.0,1.0).operator *(translationMatrix(Vector3(-4.7, 5.0, 1.5)).operator *(rotationMatrix(M_PI/2,Vector3(0.0,1.0,0.0)))));

    for(int i=0;i<2;i++){
        loja->addObject(new ShipJosh(), scaleMatrix(0.4,0.4,0.4).operator *(translationMatrix(Vector3(-(i*2)-9, 5.0, 6.5))));
    }

    for(int i=0;i<2;i++){
        loja->addObject(new ShipJosh(), scaleMatrix(0.4,0.4,0.4).operator *(translationMatrix(Vector3(-(i*2)-9, 2.5, 6.5))));
    }

    for(int i=0;i<3;i++){
        loja->addObject(new BikeJosh(), scaleMatrix(2.5,2.5,2.5).operator * (translationMatrix(Vector3(0.8, 0.3, 0.2+(i*0.6)))));
    }

    loja->addObject(new Prateleira1Bruno(), translationMatrix(Vector3(-5.0, 1.0, 3.0)));
    loja->addObject(new AlicerceJoshua(), scaleMatrix(1.0,1.0,1.0).operator *(translationMatrix(Vector3(0.2, -1.0, 0.0))));

    // FIM PARTE JOSHUA


    // PARTE RONEY

    loja->addObject(new AnimalBrinquedoRoney(), scaleMatrix(-0.2,0.2,-0.2).operator * (translationMatrix(Vector3(18.0, 12.3, 6))));
    loja->addObject(new AnimalBrinquedoRoney(), scaleMatrix(-0.2,0.2,-0.2).operator * (translationMatrix(Vector3(18.0, 12.3, 1.5))));
    loja->addObject(new ArvoreNatalRoney(), scaleMatrix(-0.2,0.2,-0.2).operator * (translationMatrix(Vector3(18,5.3,6))));
    loja->addObject(new ArvoreNatalRoney(), scaleMatrix(-0.2,0.2,-0.2).operator * (translationMatrix(Vector3(18,5.3,1.5))));

    loja->addObject(new Prateleira1Bruno(), translationMatrix(Vector3(-5, 1.0, 0.0)));
    // FIM PARTE RONEY

    return loja;

}
